return size_group->priv->widgets;
}
-static void
-compute_dimension (GtkWidget *widget,
- GtkSizeGroupMode mode,
- gint for_size,
- gint *minimum, /* in-out */
- gint *natural) /* in-out */
+/**
+ * _gtk_size_group_bump_requisition:
+ * @widget: a #GtkWidget
+ * @mode: either %GTK_SIZE_GROUP_HORIZONTAL or %GTK_SIZE_GROUP_VERTICAL, depending
+ * on the dimension in which to bump the size.
+ * @for_size: Size to request minimum and natural size for
+ * @minimum: a pointer to the widget's minimum size
+ * @natural: a pointer to the widget's natural size
+ *
+ * Refreshes the sizegroup while returning the groups requested
+ * value in the dimension @mode.
+ *
+ * This function is used both to update sizegroup minimum and natural size
+ * information and widget minimum and natural sizes in multiple passes from
+ * the size request apis.
+ */
+void
+_gtk_size_group_bump_requisition (GtkWidget *widget,
+ GtkSizeGroupMode mode,
+ gint for_size,
+ gint *minimum,
+ gint *natural)
{
GSList *widgets;
GSList *tmp_list;
gint min_result = 0, nat_result = 0;
+ if (!_gtk_widget_get_sizegroups (widget))
+ return;
+
widgets = widget_get_size_group_peers (widget, mode);
g_slist_foreach (widgets, (GFunc)g_object_ref, NULL);
}
else
{
- if (mode == GTK_SIZE_GROUP_HORIZONTAL)
- {
- if (for_size < 0)
- gtk_widget_get_preferred_width (tmp_widget, &min_dimension, &nat_dimension);
- else
- gtk_widget_get_preferred_width_for_height (tmp_widget, for_size, &min_dimension, &nat_dimension);
- }
- else
- {
- if (for_size < 0)
- gtk_widget_get_preferred_height (tmp_widget, &min_dimension, &nat_dimension);
- else
- gtk_widget_get_preferred_height_for_width (tmp_widget, for_size, &min_dimension, &nat_dimension);
- }
+ _gtk_widget_compute_size_for_orientation (tmp_widget, mode, TRUE, for_size, &min_dimension, &nat_dimension);
}
min_result = MAX (min_result, min_dimension);
*natural = nat_result;
}
-/**
- * _gtk_size_group_bump_requisition:
- * @widget: a #GtkWidget
- * @mode: either %GTK_SIZE_GROUP_HORIZONTAL or %GTK_SIZE_GROUP_VERTICAL, depending
- * on the dimension in which to bump the size.
- * @for_size: Size to request minimum and natural size for
- * @minimum: a pointer to the widget's minimum size
- * @natural: a pointer to the widget's natural size
- *
- * Refreshes the sizegroup while returning the groups requested
- * value in the dimension @mode.
- *
- * This function is used both to update sizegroup minimum and natural size
- * information and widget minimum and natural sizes in multiple passes from
- * the size request apis.
- */
-void
-_gtk_size_group_bump_requisition (GtkWidget *widget,
- GtkSizeGroupMode mode,
- gint for_size,
- gint *minimum,
- gint *natural)
-{
- if (!_gtk_widget_get_sizegroup_bumping (widget))
- {
- /* Avoid recursion here */
- _gtk_widget_set_sizegroup_bumping (widget, TRUE);
-
- if (_gtk_widget_get_sizegroups (widget))
- compute_dimension (widget, mode, for_size, minimum, natural);
-
- _gtk_widget_set_sizegroup_bumping (widget, FALSE);
- }
-}
-
-
-
/**
* _gtk_size_group_queue_resize:
* @widget: a #GtkWidget
/* SizeGroup related flags */
guint sizegroup_visited : 1;
- guint sizegroup_bumping : 1;
guint have_size_groups : 1;
/* The widget's name. If the widget does not have a name
widget->priv->sizegroup_visited = visited;
}
-gboolean
-_gtk_widget_get_sizegroup_bumping (GtkWidget *widget)
-{
- return widget->priv->sizegroup_bumping;
-}
-
-void
-_gtk_widget_set_sizegroup_bumping (GtkWidget *widget,
- gboolean bumping)
-{
- widget->priv->sizegroup_bumping = bumping;
-}
-
void
_gtk_widget_add_sizegroup (GtkWidget *widget,
gpointer group)